import instance from "../utils/resqust";
import { roleInfoType } from "../types/roleInfo";

//新增角色
export const roleInfoPost = (roleInfo:roleInfoType) => {
    return instance.post("classes/role", roleInfo);
}


//查询角色列表
export const roleInfoGet = (roleId?: string) => {
    let where:any= {
        objectId:roleId
    }
    where = JSON.stringify(where);
    return instance.get("classes/role", {
        params: {
            where
        }
    });
}


//删除角色列表
export const roleInfoDel = (objectId:string) => {
    return instance.delete(`classes/role/${objectId}`);
}


//编辑角色
export const roleInfoPut = (objectId: string, roleInfo:roleInfoType) => {
    return instance.put(`classes/role/${objectId}`,roleInfo);
}